package com.mb.app.service.impl;


import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.mb.app.dao.TbUserInfoMapper;
import com.mb.app.domain.TbUserInfo;
import com.mb.app.service.ITbUserInfoService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户信息  服务实现类
 * </p>
 *
 * @author liliping
 * @since 2019-03-21
 */
@Service
public class TbUserInfoServiceImpl extends ServiceImpl<TbUserInfoMapper, TbUserInfo> implements ITbUserInfoService {

    @Override
    public List<TbUserInfo> queryList(Map<String, Object> map) {
        List<TbUserInfo> list = this.baseMapper.lst(map);
        return list;
    }

    @Override
    public int count(Map<String, Object> map) {
        return this.baseMapper.count(map);
    }


    @Override
    public int remove(Long userId) {
//        return this.baseMapper.deleteById(appId);
        TbUserInfo tbUserInfo = new TbUserInfo();
        tbUserInfo.setUserId(userId);
        tbUserInfo.setDataStatus(0);
        return this.baseMapper.updateById(tbUserInfo);
    }

    @Override
    public int status(Long userId,Integer userstatus) {
//        return this.baseMapper.deleteById(appId);
        TbUserInfo tbUserInfo = new TbUserInfo();
        tbUserInfo.setUserId(userId);
        tbUserInfo.setUserStatus(userstatus);
        return this.baseMapper.updateById(tbUserInfo);
    }

    @Override
    public List<TbUserInfo> queryListChannel(Map<String, Object> map) {
        List<TbUserInfo> list = this.baseMapper.listChannel(map);
        return list;
    }

    @Override
    public int countChannel(Map<String, Object> map) {
        return this.baseMapper.countChannel(map);
    }

    @Override
    public TbUserInfo getDtl(Long userId) {
        return this.baseMapper.selectById(userId);
    }

}
